#include	"zip.h"
#include	"miniz/miniz.h"

int ZIP::Compress(char * dest, size_t & out_size, const char * src, size_t src_size) {
	mz_ulong buf_size = (mz_ulong)out_size;
	int status = mz_compress((unsigned char *)dest, &buf_size, (const unsigned char *)src, (mz_ulong)src_size);
	out_size = (size_t)buf_size;
	return status;
}

int ZIP::Uncompress(char * dest, size_t & out_size, const char * src, size_t src_size) {
	mz_ulong buf_size = (mz_ulong)out_size;
	int status = mz_uncompress((unsigned char *)dest, &buf_size, (const unsigned char *)src, (mz_ulong)src_size);
	out_size = (size_t)buf_size;
	return status;
}